//package com.etv.launcher.ui.presenter;
//
//import android.view.View;
//import android.view.ViewGroup;
//import android.widget.ImageView;
//import android.widget.TextView;
//
//import androidx.leanback.widget.Presenter;
//
//import com.etv.launcher.R;
//import com.etv.launcher.model.entity.ApplicationInfoEntity;
//
//public class ApplicationPresenter extends Presenter {
//
//    @Override
//    public Presenter.ViewHolder onCreateViewHolder(ViewGroup parent) {
//        // 创建自定义视图（包含图标和名称）
//        View view = View.inflate(parent.getContext(), R.layout.item_application, null);
//        return new ViewHolder(view);
//    }
//
//    @Override
//    public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) {
//        ApplicationInfoEntity app = (ApplicationInfoEntity) item;
//        ViewHolder holder = (ViewHolder) viewHolder;
//
//        holder.icon.setImageDrawable(app.getIcon());
//        holder.name.setText(app.getAppName());
//    }
//
//    @Override
//    public void onUnbindViewHolder(Presenter.ViewHolder viewHolder) {
//
//    }
//
//    public static class ViewHolder extends Presenter.ViewHolder {
//        ImageView icon;
//        TextView name;
//
//        public ViewHolder(View view) {
//            super(view);
//            icon = view.findViewById(R.id.icon);
//            name = view.findViewById(R.id.name);
//        }
//    }
//}